import { axios } from '@/utils/request'

const api = {
  device: '/shifts/device'
}

export function getDeviceList (parameter) {
  return axios({
    url: api.device + '/list',
    method: 'get',
    params: parameter
  })
}

export function saveDevice (parameter) {
  return axios({
    url: api.device + (parameter.deviceId != null ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delDevice (parameter) {
  return axios({
    url: api.device + '/remove',
    method: 'post',
    params: parameter
  })
}

export const deviceExport = api.device + '/export'
